Troubleshooting the Bally/Astrocade Motherboard Power Up with SetScreen, A New Tool A MCM Design project By Michael Matte September 20, 2017 This posting is for anyone with experience in troubleshooting the Bally/Astrocade motherboard. The posting was written by the one who designed and built a modified Astrocade that runs with low or high resolution graphics. The posting addresses the scenario in which a blank TV screen appears when powering on a motherboard and describes a new, very useful tool to help isolate the problem area. I purchased an Astrocade from EBay and found the motherboard to be operating nearly perfectly. After a few power ups and runs, the motherboard operation began to deteriorate. One day, I discovered the motherboard would only display a blank TV screen when turned on. I checked out all the clocks with a frequency counter, the power supply voltages and the power voltages to all the chips. All these checked out ok. I ran Balcheck on the motherboard and it told me the Z80 CPU and ROM chip were operating. Balcheck also told me that all the 8 video data lines were in error. Not a good checkup by Balcheck. I looked at the motherboard schematic and determined that any of 14 chips on the motherboard, if bad, could produce this Balcheck error. This chip count includes the custom address and data chips but excludes the 8 RAM chips. I came up with an idea that I thought might simplify isolating a bad chip with the aid of a logic probe. Little did I know that I would accidently create a very useful tool to help isolate the problem area. SetScreen MAY HELP TROUBLESHOOT BLANK SCREEN SCENARIO Certain motherboard failures, other than a bad video output, cause the TV screen to go blank. Does the custom data chip suddenly take a pizza break? When you examine on-board sub#72, pizza break, you find the subroutine zeroing all 8 color registers. So, all the pixels in the screen RAM area are set to the color black and the background area around the screen RAM area on the TV screen is also black. This takes on the appearance of a blank screen. No, the custom data chip does not take a pizza break. The background color display on the TV screen is independent of whether or not screen RAM, the interface to screen RAM or the custom address chip are operating properly. What I am saying is that at least 2 colors can still be displayed on the TV screen as long as the Z80 CPU, ROM chip, Microcycler data bus and the custom data chip are all operating properly. Even if there is a problem with the address chip, interface or screen RAM, the SetScreen TV display may still show things going on within the screen RAM area on the display which might help you isolate a problem area. POWERING UP THE MOTHERBOARD The Nutting Manual documents the ROM power up routine beginning at address 0000H. Before the routine begins initializing certain parameters and setting up screen RAM for the menu, it checks address 2000H for a ROM cartridge there beginning with the sentinel code C3H (a jump op code). If that sentinel code C3H is present, then the Z80 CPU jumps to location 2000H bypassing the menu. This allows any programmer to decide how to set up the screen display. I have an Astrocade with a user memory add-on switchable from 6000H to 2000H. The add-on also allows me to place an EEPROM at location 2000H. I used an EEPROM programmed with variations of the SetScreen routine listed below to determine the initialization of the 3 screen parameters in SetScreen IMMEDIATELY upon powering on the motherboard. This is what I found out. I am assuming the custom data chip is the chip that initializes these 3 parameters. A. All 8 colors registers, output ports 00H to 07H, are initialized to zero (color black). B. The horizontal color boundary/background color, output port 09H, is initialized to zero. The background color is per color reg 0 and the entire screen RAM area display is per color reg's 0, 1, 2 and 3. The pixels colors are irrelevant (see C below). C. The vertical blank register, output port 0AH, ie, the vertical blank line is initialized to zero, which is the very top of the screen RAM display and hides all the pixels. Immediately at power on, the custom data chip blacks out (blanks) the TV screen. Because of the initialization by the data chip described in above A, B, and C above, these 3 parameters must be changed in a power up routine using the appropriate output instructions. Note also that once these 3 parameters are set by a program, a manual rest of the reset button will not change them. It is typical during normal power up to see instead of the menu, a scrambled display of pixels with menu colors. One must press the reset button to display the menu. I can only speculate as to why a scrambled display appears. The Z80 CPU begins executing the power up routine outputting the menu colors but then apparently wanders off somewhere never getting to that part of the power up routine that sets up the menu. Very peculiar. I have also observed that at power up when the menu is displayed automatically (reset button is not pressed), you always see briefly that scrambled pixel display right before the menu appears. Is the Z80 CPU resetting itself twice? SCREEN COLOR SET UP IN THE ROM POWER UP ROUTINE Let's take a look at the power up routine in ROM. When you press the reset button, the Z80 CPU is manually "reset" which forces the CPU to begin executing machine language instructions at ROM address 0000H, which is where the power up routine begins. Sometimes the Z80 CPU resets automatically when the power on/off switch is pushed on. The power up routine begins by executing a disable interrupts instruction, outputting to port 08H telling the custom chips to operate in low resolution and then checks for a cassette sentinel C3H (a jump op code) at 2000H. If the sentinel C3H is not present, the power up routine then continues. Immediately following the sentinel check, the stack pointer is set and then the screen RAM scratchpad at 4FCE to 4FFFH is zeroed (cleared). Note that the power up routine, shortly after clearing the scratchpad, then turns off all sound, sets the vertical blank register, horizontal color boundary and finally sets the screen colors. Now what will happen at power up if there is some kind of problem with the motherboard that will not allow the Z80 CPU to write to or read from screen RAM? When the Z80 CPU begins executing the power up routine, it will come to the instructions to clear the scratchpad. Because of that problem, the CPU will not be able to process that task. Why? Because clearing the scratchpad is accomplished using on-board sub#26. The on-board UPI processes that call using the stack in screen RAM to save and read data. Because of that problem the CPU is unable to write or read stack data. So, the CPU wanders off who knows where and never gets around to setting any screen colors. Thus, the TV screen remains blacked out (blank) when powering on the motherboard. Whoever programmed the power up routine was more concerned with the routine's total byte count rather than making it a little easier to troubleshoot a motherboard. The programmer should have, immediately following the cassette sentinel check, set the TV screen parameters including the colors, then initialized the stack, scratchpad, screen RAM, etc. This small change in the order of power up tasks would have simplified troubleshooting the motherboard. However, the TV screen parameters have to be set with direct machine language output instructions, ie, no subroutine calls. To prove my point, I programmed an EEPROM with the SetScreen routine listed below. I inserted the EEPROM in my hi-res Astrocade user RAM socket, which is switchable from 6000H to 2000H, leaving the switch at 6000H. I pulled out from its socket my screen RAM address A0-A5 buffer chip on my hi-res RAM board which is equivalent to removing chip U20 on a motherboard. Removing this chip will mean screen RAM cannot be addressed or refreshed. When I turned on my Astrocade I got a blank screen. When I flipped the switch to 2000H and pressed the reset button, I immediately saw the TV screen split in half in color, with a black background on the left side and a blue background on the right side. I even saw the screen RAM area on the TV screen in color with vertical colored stripes top to bottom within the screen RAM area. SetScreen DESCRIPTION Below is a listing of the SetScreen routine. All this routine does is stop all sound output and set 3 screen parameters: the vertical blank register, horizontal color boundary/background color and screen colors. The routine ends by instructing the Z80 CPU to "Halt". SetScreen takes over when the normal power up routine fails to set the TV screen parameters (screen goes blank) because of a related screen RAM failure. SetScreen will display at least 2 background colors on the TV screen IF the Z80 CPU, the ROM chip, the Microcyler data bus and custom data chip are operating. +++++++++++++++ SetScreen LISTING +++++++++++++++ 2000H C3 0B 20 JP SetScreen COLOR TABLE 2003H AC green, left colors 86 yellow 07 white 00 black CD cyan, right colors 5A red 2B magenta F9 blue SetScreen 200BH AF XOR A A=0 01 18 08 LD BC, 0818H stop all sound ED 79 OUT(C), A 2011H 10 FC DJNZ-2 3E C8 LD A, 200 set vert blk reg = 200 D3 0A OUT(0AH), A 3E 14 LD A, 20 set horiz clr bndry = 20, split scrn D3 09 OUT(09H), A 21 03 20 LD HL, CLRTBL set all color regs via output port 0BH 01 0B 08 LD BC, 080BH 2021H ED B3 OTIR 2023H 76 HALT halt CPU, DI at 0001H Notes: Left background = black, right background = blue. Left pixels blk(00), wht(01), yel(10), grn(11). Right pixels blu(00), mag(01), red(10),cyn(11). No RAM writes or reads. RAM is not cleared. To exit "Halt", remove above routine from 2000H, press reset button. Place SetScreen routine at 2000H prior to powering on motherboard. +++++++++++++++ SetScreen HARDWARE +++++++++++++++ SetScreen must reside at 2000H. Load SetScreen into an EPROM or EEPROM. There are two options for the programmed EPROM/EEPROM. Place it in or on top of a game cartridge or if you have a user RAM add-on with a compatible static RAM socket switchable to 2000H, you can insert the programmed chip in that socket. RUN Balcheck BEFORE SetScreen If you have Balcheck, run it before you run SetScreen. Balcheck will tell you if the Z80 CPU and ROM chip are operating. Balcheck can also report if any of the 8 video data lines are in error plus check for additional errors. RUNNING SetScreen ON MOTHERBOARD DISPLAYING BLANK SCREEN 1. Remove 4 screws which fasten cassette holder to motherboard. 2. Insert SetScreen cartridge into cassette holder (or insert and flip SetScreen in your user RAM add-on to 2000H). 3. Turn on motherboard power and push down reset button. You might have to push down on cassette holder to insure cartridge is making contact with the cassette interface connector. 4. If the TV screen does NOT display a split color screen with at least 2 colors, black on left and blue on right, try re-inserting again the cartridge and push down the reset button. 5. If the split color screen still does not display, check the HALT pin 18 at the Z80 CPU for a logic 0 (low). The Z80 CPU HALT (active low) output signal goes low when the CPU is in the HALT state. If this pin is at a logic 1 (high), it's an indication SetScreen was not executed. If this pin IS low, it's an indication Setscreen was executed but there may be a problem related to the Microcycler data bus or custom address chip. In either case, the custom data chip is not processing SetScreen's 3 parameter set up. TROUBLESHOOTING WHEN SetScreen DOES NOT DISPLAY COLOR SPLIT SCREEN When SetScreen displays the split color screen, it's an indication that the custom data chip has received SetScreen's parameters set up and processed them. I am assuming the custom data chip is the custom chip that processes these output instructions because it's the chip with the video output signal. If the SetScreen split color screen does not appear, a motherboard failure is related to any of the following: Z80 CPU, U5 ROM chip or decoder Microcycler Custom data chip cassette connector or decoder SetScreen cartridge Note: Balcheck will tell you if the Z80 CPU and ROM chip are operating. TROUBLESHOOTING WHEN SetScreen DISPLAYS COLOR SPLIT SCREEN If the color split screen appears, a motherboard failure is related to any of the following: Screen RAM interface Custom address chip Screen RAM Note: Balcheck will report if any of the video data lines are in error. SetScreen does not change any data in screen RAM and places the Z80 CPU in a HALT state. When you run SetScreen and the color split screen appears on the screen with black on the left half and blue on the right half, the following is what this tool will tell you: 1. SetScreen's 3 screen parameters were processed and executed. 2. The Z80 CPU and ROM chip are operating. 3. The Microcycler data bus MXD0-MXD7 is operating. Microcycler chips U8, U9, U10, U13 and U6 are operating. 4. The custom data chip is operating. The video output signal at pin 24 is operating. The Microcycler output signals MC0 (pin 18) and MC1 (pin 17) are operating. The data chip is outputting the 1.789 MHz system clock signal (pin 16). Besides seeing the 2 color split screen, you may see things going on WITHIN the screen RAM area of the screen. 1. You may see random pixel colors or colored vertical stripes. 2. You may see pixels fading out and in. This is an indication the custom data chip is having difficulty receiving (scanning) data from screen RAM for the video output display. Remember, the Z80 CPU is in the halt state. It is not writing to or reading from memory .The CPU is only sending the refresh address to the custom address chip. 3. You may see horizontal white speckles moving about within the screen RAM area only. Additional easy checks. Since the Z80 CPU is halted and NOT writing to screen RAM memory: 1. DATEN (Data Enable, active low) should be at a logic 1 (high). Check pin 5 at U11. 2. Pin 1 at U23 should be at a logic 0 (low) enabling U23. If it is at high, check pin 4 at U11. If this pin is also high, U11 may be bad. 3. WE ( Write Enable, active low) should be at a logic 1 (high). Check pin 6 at U12. THE CPU HALT STATE During a CPU halt state, the CPU will just sit there executing internally NOP's (no operation). When the CPU halts, it does not write to or read from RAM memory. The CPU will attempt to refresh RAM and the custom data chip will attempt to scan (read) RAM for the video TV display. The custom address chip besides attempting to pass the Z80's refresh address will also generate and increment the video scan address. The CPU will remain in the halt state until the reset button is pressed. Placing the CPU in a known halt state makes it a little easier to isolate a problem area when trouble shooting. During a CPU halt state, the CPU will continue generating the M1 (Machine 1) cycle placing the refresh address (counter) A0-A6 on the lower address lines A0-A6 during the latter half of the M1 cycle. It might (I found no info on this point) continue to place the contents of the CPU's PC register (program counter) on the address bus during the first half of the M1 cycle and then increment the PC register at the end of each M1 cycle. Any attempt by the CPU at fetching data following the halt instruction will be ignored by the CPU. Note that the on-board power up routine begins at 0000H and there is a "disable interrupts" instruction at address 0001H. To exit the halt state when SetScreen is executed, remove Setscreen from address 2000H and press the rest button. FINAL COMMENTS If you're not utilizing Balcheck to help troubleshoot a failed motherboard, you should seriously consider downloading it from the Bally Alley and building a fairly simple Balcheck error code display. Using Balcheck and SetScreen on a motherboard producing a blank TV screen will save you troubleshooting time and grief. I have written an upgraded version of Balcheck called Balcheck II which will also check RAM add-ons and a high resolution screen map. I'm planning to add SetScreen to Balcheck II. Balcheck II will be posted on the Bally Alley hopefully by the end of this year. The posting will also include a revised schematic for the Balcheck error code display. Thanks to Balcheck and SetScreen, I was able to make a logical determination of the failed part on the EBay motherboard I mentioned at the beginning of this posting. My determination was made surprising fast because of these two tools. I de-soldered just one chip, the octal buffer U23 which was bad. End of posting. 9/30/2017